/*
 * @Description: 接口
 * @Author: charles
 * @Date: 2021-11-19 11:59:28
 * @LastEditors: charles
 * @LastEditTime: 2021-11-19 12:06:50
 */
class Student{
  id:number;
  name:string;
  age:number;
  constructor(id:number,name:string,age:number){
    this.id = id;
    this.name = name;
    this.age = age;
  }
}
interface IStudentService{
  pageQuery(page:number,pageSize:number):Array<Student>;
  queryById(id:number):Student;
  save(student:Student):string;
}

class StudentServiceImpl implements IStudentService {
  pageQuery(page:number,pageSize:number):Array<Student>{
    let s1:Student = new Student(1,'terry',12);
    let s2:Student = new Student(2,'jacky',12);
    return new Array<Student>(s1,s2);
  }

  queryById(id:number):Student{
    let s1:Student = new Student(id,'terry',12);
    return s1;
  }

  save(student:Student):string{
    return '保存成功';
  }

  foo(){

  }
}

let ss:IStudentService = new StudentServiceImpl();
let result:Array<Student> = ss.pageQuery(1,10);
console.log(result);
